package com.candicom.race.cars;

public class CarFactory {

    public static AbstractCar createACar(CarModel _model) {

        AbstractCar retVal = null;

        try {
            if (_model == CarModel.BMW) {
                retVal = new BMW();

            } else if (_model == CarModel.AUDI) {
            } else if (_model == CarModel.MERCEDES) {
                retVal = new Mercedes();

            } else if (_model == CarModel.VOLKSWAGEN) {
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return retVal;
    }
}
